package com.jetpackframework.fixpatch;

import android.content.Context;
import android.content.res.Configuration;

import com.blankj.utilcode.util.FileUtils;
import com.gwm.annotation.router.AutoService;
import com.jetpackframework.ContextUtil;
import com.jetpackframework.applicationdelegate.ApplicationDelegate;
import com.jetpackframework.applicationdelegate.BaseApplicationDelegate;
@AutoService(ApplicationDelegate.class)
public class FixpatchAppDelegate extends BaseApplicationDelegate {
    @Override
    public void onCreate() {
        FileUtils.createOrExistsDir(ContextUtil.get().getFilesDir()+"/apk");
        FileUtils.createOrExistsDir(ContextUtil.get().getFilesDir()+"/dex");
        FileUtils.createOrExistsDir(ContextUtil.get().getFilesDir()+"/so");
        FileUtils.createOrExistsDir(ContextUtil.get().getFilesDir()+"/resource");
        Fixpatch.install(application,new Fixpatch.Builder()
                .setApkPath(ContextUtil.get().getFilesDir()+"/apk")
                .setDexPath(ContextUtil.get().getFilesDir()+"/dex")
                .setSoPath(ContextUtil.get().getFilesDir()+"/so")
                .setResourcePath(ContextUtil.get().getFilesDir()+"/resource")
                .builder());
    }

    @Override
    public void onLowMemory() {

    }

    @Override
    public void onTrimMemory(int level) {

    }

    @Override
    public void onTerminate() {

    }

    @Override
    public void onConfigurationChanged(Configuration newConfig) {

    }

    @Override
    public void onBaseContextAttached(Context base) {

    }

    @Override
    public void exit() {

    }
}
